home *** CD-ROM | disk | FTP | other *** search
/ MacFormat 1994 November / macformat-018.iso / Utility Spectacular / Text / Digest-Browser-1.6 Folder / Views / CBrowserSizeBox.c < prev    next >
Encoding:
Text File  |  1992-08-29  |  1.7 KB  |  58 lines  |  [TEXT/KAHL]

  1. /******************************************************************************
  2.  CBrowserSizeBox.c
  3.  
  4.     Methods to support a size box associated with a pane instead of a window.
  5.     Needed to implement resizeable scroll panes within a single window
  6.     
  7.       Copyright © 1992 J. Robert Boonstra, II.  All rights reserved.
  8.  ******************************************************************************/
  9.  
  10. // CBrowserDoc is needed so we can adjust both parent scroll panes
  11. #include "CBrowserDoc.h"    
  12. #include "CWindow.h"        
  13. #include "CBrowserSizeBox.h"    
  14. #include "TBUtilities.h"
  15.  
  16.  
  17. /******************************************************************************
  18.  Draw {OVERRIDE}
  19.  
  20.         Draw a SizeBox
  21.  ******************************************************************************/
  22.  
  23. void CBrowserSizeBox::Draw(Rect *area)
  24. {
  25.     Point        pt;
  26.  
  27.     if (IsActive()) {        // if it is active, then we draw the icon
  28.         LongToQDPt( &topLeftL( frame), &pt);
  29.         DrawSICN(201, 1, pt);    // uses a different icon
  30.     }
  31.     else                    // otherwise, let the inherited method draw
  32.         inherited::Draw(area);
  33. }
  34.  
  35. /******************************************************************************
  36.  DoClick
  37.  ******************************************************************************/
  38.  
  39. void    CBrowserSizeBox::DoClick(
  40.     Point        hitPt,
  41.     short        modifierKeys,
  42.     long        when)
  43. {
  44. LongPt            frameHitPt;
  45. Rect            theDragBox;
  46. LongRect        theLongDragBox;
  47. CBrowserDoc    *theDoc;
  48.  
  49.     QDToFrame(hitPt,&frameHitPt);
  50.     FrameToWind(&frameHitPt,&hitPt);
  51.     
  52.     GetFrame(&theLongDragBox);
  53.     FrameToWindR(&theLongDragBox,&theDragBox);
  54.     theDoc = (CBrowserDoc *)(GetWindow()->itsSupervisor);
  55. //    tell the supervisor to adjust the pane partitions    
  56.     theDoc->AdjustPaneDivider(hitPt,&theDragBox);
  57. }                        
  58.